package com.business.dashboard.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.business.dashboard.entity.AdminUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 管理员用户数据访问接口
 * 
 * @author Claude
 * @since 2025-07-06
 */
@Mapper
public interface AdminUserDao extends BaseMapper<AdminUser> {

    /**
     * 根据用户名查找用户
     */
    AdminUser findByUsername(@Param("username") String username);

    /**
     * 根据邮箱查找用户
     */
    AdminUser findByEmail(@Param("email") String email);

    /**
     * 更新登录信息
     */
    int updateLoginInfo(@Param("id") Long id, @Param("loginIp") String loginIp);

    /**
     * 更新用户状态
     */
    int updateStatus(@Param("id") Long id, @Param("status") Integer status);

}